package com.account.boot.api.config;

import org.mybatis.spring.mapper.MapperScannerConfigurer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@AutoConfigureAfter(MyBatisConfig.class) //保证在MyBatisConfig实例化之后再实例化该类
public class MapperScannerConfig {
	
	@Autowired
	private MyBatisConfig myBatisConfig;
	
	@Bean
	public MapperScannerConfigurer mapperScannerConfigurer() throws Exception {
			
		MapperScannerConfigurer mapperScannerConfigurer = new MapperScannerConfigurer();
		mapperScannerConfigurer.setBasePackage("com.account.boot.dao");
		return mapperScannerConfigurer;
	}
}
